package com.ggx.voicereminder.util;

import android.os.Environment;
import android.os.StatFs;

public class AudioFile {

	public static long getAvailableStorage() {

		String storageDirectory = null;
		storageDirectory = Environment.getExternalStorageDirectory().toString();

		try {
			StatFs stat = new StatFs(storageDirectory);
			long avaliableSize = ((long) stat.getAvailableBlocks() * (long) stat.getBlockSize());
			return avaliableSize;
		} catch (RuntimeException ex) {
			return 0;
		}
	}

	public static boolean isSDCardPresent() {

		return Environment.getExternalStorageState().equals(Environment.MEDIA_MOUNTED);
	}
}
